-- GENERATED SPELL FOR [Millhouse Manastorm] --


function spell0_20977(pUnit, Event) --@Arcane Intellect,Self--
pUnit:FullCastSpellOnTarget(36880,pUnit)
pUnit:RegisterEvent('Sorts_20977', 602, 1)
end

function spell1_20977(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(33833,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20977', 581, 1)
end

function spell2_20977(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(12611,pUnit)
pUnit:RegisterEvent('Sorts_20977', 8321, 1)
end

function spell3_20977(pUnit, Event) --@Conjure Water,Self--
pUnit:FullCastSpellOnTarget(36879,pUnit)
pUnit:RegisterEvent('Sorts_20977', 3000, 1)
end

function spell4_20977(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(13341,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20977', 603, 1)
end

function spell5_20977(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(14034,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20977', 3000, 1)
end

function spell6_20977(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(15497,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20977', 7000, 1)
end

function spell7_20977(pUnit, Event) --@Ice Armor,Self--
pUnit:FullCastSpellOnTarget(36881,pUnit)
pUnit:RegisterEvent('Sorts_20977', 592, 1)
end

function spell8_20977(pUnit, Event) --@Ice Block,Self--
pUnit:FullCastSpellOnTarget(36911,pUnit)
pUnit:RegisterEvent('Sorts_20977', 10258, 1)
end

function spell9_20977(pUnit, Event) --@Pyroblast,n/a--
pUnit:FullCastSpellOnTarget(33975,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20977', 18000, 1)
end

function Sorts_20977(pUnit, Event)
local choix_sorts_20977 = math.random(0, 9)
if choix_sorts_20977 == 0 then
pUnit:RegisterEvent('spell0_20977', 1, 1)
end
if choix_sorts_20977 == 1 then
pUnit:RegisterEvent('spell1_20977', 1, 1)
end
if choix_sorts_20977 == 2 then
pUnit:RegisterEvent('spell2_20977', 1, 1)
end
if choix_sorts_20977 == 3 then
pUnit:RegisterEvent('spell3_20977', 1, 1)
end
if choix_sorts_20977 == 4 then
pUnit:RegisterEvent('spell4_20977', 1, 1)
end
if choix_sorts_20977 == 5 then
pUnit:RegisterEvent('spell5_20977', 1, 1)
end
if choix_sorts_20977 == 6 then
pUnit:RegisterEvent('spell6_20977', 1, 1)
end
if choix_sorts_20977 == 7 then
pUnit:RegisterEvent('spell7_20977', 1, 1)
end
if choix_sorts_20977 == 8 then
pUnit:RegisterEvent('spell8_20977', 1, 1)
end
if choix_sorts_20977 == 9 then
pUnit:RegisterEvent('spell9_20977', 1, 1)
end
end

function mob20977_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20977', math.random(1500, 3000), 1)
end

function mob20977_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20977_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20977_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20977, 1, 'mob20977_Action')
RegisterUnitEvent(20977, 2, 'mob20977_Leave')
RegisterUnitEvent(20977, 3, 'mob20977_Kill')
RegisterUnitEvent(20977, 4, 'mob20977_Die')
